<?php
class Core_Model_Object
{
	protected static $modules	= array('P', 'C', 'G', 'M');
	
	protected static $_mapper;
	
	public static function loadObject($objType, $objId = null)
	{
		$module		= substr($objType, 0, 1);
		$className	= substr($objType, 1);
		
		switch($module)
		{
			case 'P':
				$class	= 'Player_Model_' . $className;
				break;
			case 'C':
				$class	= 'Core_Model_' . $className;
				break;
			case 'G':
				$class	= 'Game_Model_' . $className;
				break;
			case 'M':
				$class	= 'Gm_Model_' . $className;
				break;
			default:
				throw new Core_Model_Exception('Invalid Module');	
		}
		
		$object	= new $class;
		if (null !== $objId)
		{
			self::loadObjectId($object, $objId);		
		}
		
		return $object;
	}
	
	public static function loadObjectId(Core_Model_Object_Interface $object, $id)
	{
		$object->setObjectId($id);
		$object->loadObject();
	}
	
	public static function saveObject(Core_Model_Object_Interface $object)
	{
		$reflect	= new ReflectionObject($object);
		$class		= $reflect->getName();
		
		$module		= substr($class, 0, 1);
		
		
	}
}